module.exports = (sequelize, Sequelize) => {
  const FileMetadata = sequelize.define("FileMetadata", {
    id: {
      type: Sequelize.INTEGER,
      primaryKey: true,
      autoIncrement: true
    },
    cosKey: {
      type: Sequelize.STRING,
      allowNull: false,
      unique: true
    },
    nickname: {
      type: Sequelize.STRING,
      allowNull: true
    },
    thumbnailUrl: {
      type: Sequelize.STRING,
      allowNull: true
    },
    type: {
      type: Sequelize.STRING,
      allowNull: false,
      defaultValue: 'file'
    }
  });

  return FileMetadata;
}; 